
<!DOCTYPE HTML>
<html lang="" >
    <head>
        <meta charset="UTF-8">
        <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
        <title>Java 基础 -- LinkedHashMap 的使用和原理 · 寒江蓑笠的博客</title>
        <meta http-equiv="X-UA-Compatible" content="IE=edge" />
        <meta name="description" content="介绍 LinkedHashMap 的使用和原理">
        <meta name="generator" content="GitBook 3.2.3">
        
        
        
    
    <link rel="stylesheet" href="../../gitbook/style.css">

    
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-highlight/website.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-search/search.css">
                
            
                
                <link rel="stylesheet" href="../../gitbook/gitbook-plugin-fontsettings/website.css">
                
            
        

    

    
        
    
        
    
        
    
        
    
        
    
        
    

        
    
    
    <meta name="HandheldFriendly" content="true"/>
    <meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
    <meta name="apple-mobile-web-app-capable" content="yes">
    <meta name="apple-mobile-web-app-status-bar-style" content="black">
    <link rel="apple-touch-icon-precomposed" sizes="152x152" href="../../gitbook/images/apple-touch-icon-precomposed-152.png">
    <link rel="shortcut icon" href="../../gitbook/images/favicon.ico" type="image/x-icon">

    
    
    <link rel="prev" href="java-basic-knowledge-about-string.html" />
    

    </head>
    <body>
        
<div class="book">
    <div class="book-summary">
        
            
<div id="book-search-input" role="search">
    <input type="text" placeholder="Type to search" />
</div>

            
                <nav role="navigation">
                


<ul class="summary">
    
    

    

    
        
        
    
        <li class="chapter " data-level="1.1" data-path="../../">
            
                <a href="../../">
            
                    
                    Java
            
                </a>
            

            
            <ul class="articles">
                
    
        <li class="chapter " data-level="1.1.1" data-path="java-basic-joor.html">
            
                <a href="java-basic-joor.html">
            
                    
                    Java 基础 -- 使用 JOOR 实现反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.2" data-path="java-basic-annotation.html">
            
                <a href="java-basic-annotation.html">
            
                    
                    Java基础 -- 注解
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.3" data-path="java-basic-threadlocal.html">
            
                <a href="java-basic-threadlocal.html">
            
                    
                    Java 基础 -- ThreadLocal
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.4" data-path="java-development-skills-get-stacktrace.html">
            
                <a href="java-development-skills-get-stacktrace.html">
            
                    
                    Java 开发技巧 -- 获取 Java 的调用栈
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.5" data-path="java-basic-concurrent-map-collection.html">
            
                <a href="java-basic-concurrent-map-collection.html">
            
                    
                    Java 基础 -- 并发集合的使用
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.6" data-path="java-dynamic-proxy-invocationhandler-demo.html">
            
                <a href="java-dynamic-proxy-invocationhandler-demo.html">
            
                    
                    Java InvocationHandler 实现动态代理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.7" data-path="java-basic-try-catch-finally.html">
            
                <a href="java-basic-try-catch-finally.html">
            
                    
                    Java 基础 -- 深入理解 try catch finally
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.8" data-path="java-basic-reflect.html">
            
                <a href="java-basic-reflect.html">
            
                    
                    Java 基础 -- 反射
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.9" data-path="java-basic-io-stream.html">
            
                <a href="java-basic-io-stream.html">
            
                    
                    Java IO -- IO流的概念和分类
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.10" data-path="java-basic-final.html">
            
                <a href="java-basic-final.html">
            
                    
                    Java 基础 -- 深入理解 final 修饰符
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.11" data-path="java-basic-memory-manage-constructor.html">
            
                <a href="java-basic-memory-manage-constructor.html">
            
                    
                    Java 内存管理 -- 父子实例的内存控制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.12" data-path="java-basic-memory-manage-inherit-object.html">
            
                <a href="java-basic-memory-manage-inherit-object.html">
            
                    
                    Java 内存管理 -- 构造方法
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.13" data-path="java-basic-memory-manage-memory-area.html">
            
                <a href="java-basic-memory-manage-memory-area.html">
            
                    
                    Java 内存管理 -- 内存区域的划分
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.14" data-path="java-basic-memory-manage-variable.html">
            
                <a href="java-basic-memory-manage-variable.html">
            
                    
                    Java 内存管理 -- 变量的内存管理
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.15" data-path="java-basic-knowledge-generic.html">
            
                <a href="java-basic-knowledge-generic.html">
            
                    
                    Java 基础 -- 范型
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.16" data-path="java-basic-knowledge-auto-boxing.html">
            
                <a href="java-basic-knowledge-auto-boxing.html">
            
                    
                    Java 基础 -- 关于自动装箱和拆箱机制
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.17" data-path="java-basic-knowledge-parameter-passing.html">
            
                <a href="java-basic-knowledge-parameter-passing.html">
            
                    
                    Java 基础 -- 值传递、引用传递和参数传递
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.18" data-path="java-basic-stringbuilder-stringbuffer.html">
            
                <a href="java-basic-stringbuilder-stringbuffer.html">
            
                    
                    Java 基础 -- StringBuilder 和 StringBuffer
            
                </a>
            

            
        </li>
    
        <li class="chapter " data-level="1.1.19" data-path="java-basic-knowledge-about-string.html">
            
                <a href="java-basic-knowledge-about-string.html">
            
                    
                    Java 基础 -- 深入理解 String
            
                </a>
            

            
        </li>
    
        <li class="chapter active" data-level="1.1.20" data-path="java-basic-linkedhashmap.html">
            
                <a href="java-basic-linkedhashmap.html">
            
                    
                    Java 基础 -- LinkedHashMap 的使用和原理
            
                </a>
            

            
        </li>
    

            </ul>
            
        </li>
    

    

    <li class="divider"></li>

    <li>
        <a href="https://www.gitbook.com" target="blank" class="gitbook-link">
            Published with GitBook
        </a>
    </li>
</ul>


                </nav>
            
        
    </div>

    <div class="book-body">
        
            <div class="body-inner">
                
                    

<div class="book-header" role="navigation">
    

    <!-- Title -->
    <h1>
        <i class="fa fa-circle-o-notch fa-spin"></i>
        <a href="../.." >Java 基础 -- LinkedHashMap 的使用和原理</a>
    </h1>
</div>




                    <div class="page-wrapper" tabindex="-1" role="main">
                        <div class="page-inner">
                            
<div id="book-search-results">
    <div class="search-noresults">
    
                                <section class="normal markdown-section">
                                
                                <h2 id="&#x6982;&#x8FF0;">&#x6982;&#x8FF0;</h2>
<p>&#x524D;&#x9762;&#x6211;&#x4EEC;&#x6709;&#x4ECB;&#x7ECD; HashMap &#x7684;&#x4F7F;&#x7528;&#xFF0C;HashMap &#x4E5F;&#x662F;&#x6211;&#x4EEC;&#x7ECF;&#x5E38;&#x4F1A;&#x4F7F;&#x7528;&#x7684;&#x96C6;&#x5408;&#xFF0C;&#x672C;&#x6587;&#x6211;&#x4EEC;&#x518D;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B; LinkedHashMap &#x7684;&#x4F7F;&#x7528;&#x548C;&#x539F;&#x7406;&#x3002;</p>
<h2 id="&#x4F7F;&#x7528;&#x65B9;&#x6CD5;">&#x4F7F;&#x7528;&#x65B9;&#x6CD5;</h2>
<p>LinkedHashMap &#x4E00;&#x4E2A;&#x7279;&#x70B9;&#x5C31;&#x662F;&#x6709;&#x5E8F;&#x7684;&#x5B58;&#x50A8;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x4E0B;&#x9762;&#x5C31;&#x901A;&#x8FC7;&#x4E00;&#x4E2A;&#x4F8B;&#x5B50;&#x6765;&#x9A8C;&#x8BC1;&#x4E00;&#x4E0B;&#x3002;</p>
<pre><code>        Map&lt;String, String&gt; linkedHashMap = new LinkedHashMap&lt;&gt;();
        linkedHashMap.put(&quot;key1&quot;,&quot;value1&quot;);
        linkedHashMap.put(&quot;key2&quot;,&quot;value2&quot;);
        linkedHashMap.put(&quot;key3&quot;,&quot;value3&quot;);

        Set&lt;Map.Entry&lt;String, String&gt;&gt; set = linkedHashMap.entrySet();
        Iterator&lt;Map.Entry&lt;String, String&gt;&gt; iterator = set.iterator();
        while (iterator.hasNext()){
            Map.Entry entry = iterator.next();
            Log.e(&quot;Test&quot;,&quot;key = &quot;+entry.getKey()+&quot;, value = &quot;+entry.getValue());
        }

        // &#x4E0B;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x4E3B;&#x8981;&#x662F;&#x548C;&#x8BBF;&#x95EE;&#x6392;&#x5E8F;&#x505A;&#x5BF9;&#x6BD4;
        linkedHashMap.get(&quot;key2&quot;);

        Iterator&lt;Map.Entry&lt;String, String&gt;&gt; iterator1 = set.iterator();
        while (iterator1.hasNext()){
            Map.Entry entry = iterator1.next();
            Log.e(&quot;Test&quot;,&quot;key = &quot;+entry.getKey()+&quot;, value = &quot;+entry.getValue());
        }
</code></pre><pre><code>Test: key = key1, value = value1
Test: key = key2, value = value2
Test: key = key3, value = value3

Test: key = key1, value = value1
Test: key = key2, value = value2
Test: key = key3, value = value3
</code></pre><p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x8F93;&#x51FA;&#x662F;&#x6709;&#x5E8F;&#x7684;&#x952E;&#x503C;&#x5BF9;&#xFF0C;&#x800C;&#x4E14;&#xFF0C;&#x662F;&#x9ED8;&#x8BA4;&#x662F;&#x6309;&#x7167;&#x63D2;&#x5165;&#x987A;&#x5E8F;&#x6392;&#x5E8F;&#x7684;&#x3002;
&#x5176;&#x5B9E;&#xFF0C;&#x8FD8;&#x6709;&#x4E00;&#x79CD;&#x6392;&#x5E8F;&#x89C4;&#x5219;&#x662F;&#x6309;&#x7167;&#x8BBF;&#x95EE;&#x987A;&#x5E8F;&#x6392;&#x5E8F;&#x7684;&#xFF0C;&#x4E5F;&#x5C31;&#x662F;&#xFF0C;&#x6BCF;&#x6B21;&#x8BBF;&#x95EE;LinkedHashMap&#x90FD;&#x4F1A;&#x6539;&#x53D8;&#x5B83;&#x7684;&#x6570;&#x636E;&#x987A;&#x5E8F;&#xFF0C;&#x628A;&#x5F53;&#x524D;&#x8BBF;&#x95EE;&#x7684;&#x6570;&#x636E;&#x6392;&#x5230;&#x5C3E;&#x90E8;&#x3002;&#x8FD9;&#x4E2A;&#x89C4;&#x5219;&#x662F; LruCache &#x7684;&#x5B9E;&#x73B0;&#x57FA;&#x7840;&#x3002;</p>
<p>&#x628A;&#x4E0A;&#x9762;&#x7684;&#x4EE3;&#x7801;&#x7684; LinkedHashMap &#x6784;&#x9020;&#x65B9;&#x5F0F;&#x6539;&#x4E3A;&#x5982;&#x4E0B;&#xFF1A;</p>
<pre><code>Map&lt;String, String&gt; linkedHashMap = new LinkedHashMap&lt;&gt;(0, 0.75f, true);
......
</code></pre><pre><code>Test: key = key1, value = value1
Test: key = key2, value = value2
Test: key = key3, value = value3

Test: key = key1, value = value1
Test: key = key3, value = value3
Test: key = key2, value = value2
</code></pre><p>&#x901A;&#x8FC7;&#x6253;&#x5370;&#x7ED3;&#x679C;&#x53EF;&#x4EE5;&#x770B;&#x5230;&#xFF0C;&#x5BF9; key2 &#x7684;&#x4E00;&#x6B21;&#x8BBF;&#x95EE;&#x64CD;&#x4F5C;&#x4F1A;&#x628A;&#x8BE5;&#x8BB0;&#x5F55;&#x79FB;&#x5230;&#x5C3E;&#x90E8;&#x3002;</p>
<h2 id="&#x4EE3;&#x7801;&#x5206;&#x6790;">&#x4EE3;&#x7801;&#x5206;&#x6790;</h2>
<h3 id="&#x6784;&#x9020;&#x65B9;&#x6CD5;">&#x6784;&#x9020;&#x65B9;&#x6CD5;</h3>
<pre><code>public class LinkedHashMap&lt;K,V&gt;
    extends HashMap&lt;K,V&gt;
    implements Map&lt;K,V&gt;
</code></pre><p>LinkedHashMap &#x7EE7;&#x627F;&#x4E86; HashMap &#x5E76;&#x5B9E;&#x73B0;&#x4E86; Map &#x63A5;&#x53E3;&#xFF0C;&#x6240;&#x4EE5; LinkedHashMap &#x53EF;&#x4EE5;&#x5B8C;&#x5168;&#x4EE3;&#x66FF; HashMap &#x7684;&#x529F;&#x80FD;&#x3002;
&#x4E0B;&#x9762;&#x6765;&#x770B;&#x4E00;&#x4E0B;&#x5B83;&#x7684;&#x51E0;&#x4E2A;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#xFF1A;</p>
<pre><code>    public LinkedHashMap(int initialCapacity, float loadFactor) {
        super(initialCapacity, loadFactor);
        accessOrder = false;
    }

    public LinkedHashMap(int initialCapacity) {
        super(initialCapacity);
        accessOrder = false;
    }

    public LinkedHashMap() {
        super();
        accessOrder = false;
    }

    public LinkedHashMap(Map&lt;? extends K, ? extends V&gt; m) {
        super(m);
        accessOrder = false;
    }

    public LinkedHashMap(int initialCapacity,
                         float loadFactor,
                         boolean accessOrder) {
        super(initialCapacity, loadFactor);
        this.accessOrder = accessOrder;
    }
</code></pre><p>&#x8FD9;&#x91CC;&#x7684; accessOrder &#x5C31;&#x662F;&#x4E0A;&#x9762;&#x63D0;&#x5230;&#x7684;&#x51B3;&#x5B9A;&#x4E86; LinkedHashMap &#x7684;&#x5B58;&#x50A8;&#x987A;&#x5E8F;&#x3002;accessOrder &#x4E3A; false &#x65F6;&#x662F;&#x6309;&#x7167;&#x63D2;&#x5165;&#x987A;&#x5E8F;&#x6392;&#x5E8F;&#x7684;&#xFF0C;&#x4E3A; true &#x65F6;&#x662F;&#x6309;&#x7167; &#x8BBF;&#x95EE;&#x987A;&#x5E8F;&#x6392;&#x5E8F;&#x7684;&#x3002;
&#x53E6;&#x5916;&#xFF0C;LinkedHashMap &#x91CC;&#x9762;&#x8FD8;&#x6709;&#x4E2A; header &#x7684;&#x53D8;&#x91CF;&#xFF1A;</p>
<pre><code>private transient LinkedHashMapEntry&lt;K,V&gt; header;
</code></pre><p>&#x5B83;&#x8FD4;&#x56DE;&#x7684;&#x662F; LinkedHashMap &#x91CC;&#x7684;&#x53CC;&#x5411;&#x94FE;&#x8868;&#x7684;&#x5934;&#x8282;&#x70B9;&#xFF0C;LinkedHashMap &#x6B63;&#x662F;&#x901A;&#x8FC7;&#x8FD9;&#x4E2A;&#x94FE;&#x8868;&#x8FD8;&#x5B9E;&#x73B0;&#x6709;&#x5E8F;&#x7684;&#x5B58;&#x50A8;&#x3002;</p>
<h2 id="linkedhashmap">LinkedHashMap</h2>
<pre><code>    private static class LinkedHashMapEntry&lt;K,V&gt; extends HashMapEntry&lt;K,V&gt; {
        LinkedHashMapEntry&lt;K,V&gt; before, after;

        LinkedHashMapEntry(int hash, K key, V value, HashMapEntry&lt;K,V&gt; next) {
            super(hash, key, value, next);
        }

        private void remove() {
            before.after = after;
            after.before = before;
        }

        private void addBefore(LinkedHashMapEntry&lt;K,V&gt; existingEntry) {
            after  = existingEntry;
            before = existingEntry.before;
            before.after = this;
            after.before = this;
        }

        void recordAccess(HashMap&lt;K,V&gt; m) {
            LinkedHashMap&lt;K,V&gt; lm = (LinkedHashMap&lt;K,V&gt;)m;
            if (lm.accessOrder) {
                lm.modCount++;
                remove();
                addBefore(lm.header);
            }
        }

        void recordRemoval(HashMap&lt;K,V&gt; m) {
            remove();
        }
    }
</code></pre><p>LinkedHashMapEntry &#x7EE7;&#x627F; HashMapEntry &#xFF0C;&#x6DFB;&#x52A0;&#x4E86; before &#x548C; after &#x5C5E;&#x6027;&#x6765;&#x6784;&#x5EFA;&#x4E00;&#x4E2A;&#x53CC;&#x5411;&#x7684;&#x94FE;&#x8868;&#x3002;</p>
<h2 id="&#x65B9;&#x6CD5;&#x4ECB;&#x7ECD;">&#x65B9;&#x6CD5;&#x4ECB;&#x7ECD;</h2>
<h3 id="init-&#x65B9;&#x6CD5;">init &#x65B9;&#x6CD5;</h3>
<p>init &#x65B9;&#x6CD5;&#x5728; HashMap &#x7684;&#x6784;&#x9020;&#x65B9;&#x6CD5;&#x91CC;&#x9762;&#x8C03;&#x7528;&#xFF0C;&#x5728; LinkedHashMap &#x91CC;&#x9762;&#x91CD;&#x5199;&#x4E86;&#x8FD9;&#x4E2A;&#x65B9;&#x6CD5;&#x3002;</p>
<pre><code>    @Override
    void init() {
        header = new LinkedHashMapEntry&lt;&gt;(-1, null, null, null);
        header.before = header.after = header;
    }
</code></pre><p>&#x8FD9;&#x91CC;&#x521D;&#x59CB;&#x5316;&#x4E86;&#x4E00;&#x4E2A;&#x53EA;&#x6709;&#x5934;&#x7ED3;&#x70B9;&#x7684;&#x53CC;&#x5411;&#x94FE;&#x8868;&#x3002;</p>
<h3 id="get-&#x65B9;&#x6CD5;">get &#x65B9;&#x6CD5;</h3>
<p>LinkedHashMap &#x91CD;&#x5199;&#x4E86; HashMap &#x7684; get &#x65B9;&#x6CD5;&#xFF1A;</p>
<pre><code>    public V get(Object key) {
        // &#x8C03;&#x7528; HashMap &#x7684;getEntry&#x65B9;&#x6CD5;&#xFF0C;&#x83B7;&#x53D6;&#x4E00;&#x4E2A;&#x6570;&#x636E;&#x3002;
        LinkedHashMapEntry&lt;K,V&gt; e = (LinkedHashMapEntry&lt;K,V&gt;)getEntry(key);
        if (e == null)
            return null;
        // &#x5982;&#x679C;&#x9700;&#x8981;&#x5C31;&#x6539;&#x53D8;&#x6392;&#x5217;&#x987A;&#x5E8F;
        e.recordAccess(this);
        return e.value;
    }

        void recordAccess(HashMap&lt;K,V&gt; m) {
            LinkedHashMap&lt;K,V&gt; lm = (LinkedHashMap&lt;K,V&gt;)m;
            // &#x5982;&#x679C;&#x662F;&#x4F7F;&#x7528;&#x4E86;&#x8BBF;&#x95EE;&#x987A;&#x5E8F;&#x6392;&#x5E8F;
            if (lm.accessOrder) {
                lm.modCount++;
                // &#x79FB;&#x9664;&#x8FD9;&#x4E2A;&#x8282;&#x70B9;
                remove();
                // &#x6DFB;&#x52A0;&#x5230;&#x5934;&#x7ED3;&#x70B9;&#x7684;&#x524D;&#x9762;&#x4E5F;&#x5C31;&#x662F;&#x94FE;&#x8868;&#x7684;&#x5C3E;&#x90E8;
                addBefore(lm.header);
            }
        }
</code></pre><h3 id="&#x904D;&#x5386;&#x6570;&#x636E;">&#x904D;&#x5386;&#x6570;&#x636E;</h3>
<p>&#x4ECB;&#x7ECD;&#x904D;&#x5386;&#x6570;&#x636E;&#x5C31;&#x8981;&#x4ECB;&#x7ECD;&#x4E00;&#x4E0B; LinkedHashIterator&#xFF1A;</p>
<pre><code>    private abstract class LinkedHashIterator&lt;T&gt; implements Iterator&lt;T&gt; {
        LinkedHashMapEntry&lt;K,V&gt; nextEntry    = header.after;
        LinkedHashMapEntry&lt;K,V&gt; lastReturned = null;

        int expectedModCount = modCount;

        public boolean hasNext() {
            return nextEntry != header;
        }

        public void remove() {
            if (lastReturned == null)
                throw new IllegalStateException();
            if (modCount != expectedModCount)
                throw new ConcurrentModificationException();

            LinkedHashMap.this.remove(lastReturned.key);
            lastReturned = null;
            expectedModCount = modCount;
        }

        Entry&lt;K,V&gt; nextEntry() {
            if (modCount != expectedModCount)
                throw new ConcurrentModificationException();
            if (nextEntry == header)
                throw new NoSuchElementException();

            LinkedHashMapEntry&lt;K,V&gt; e = lastReturned = nextEntry;
            nextEntry = e.after;
            return e;
        }
    }
</code></pre><p>&#x53EF;&#x4EE5;&#x770B;&#x5230;&#x8FD9;&#x91CC;&#x5176;&#x5B9E;&#x5C31;&#x662F;&#x904D;&#x5386;&#x53CC;&#x5411;&#x94FE;&#x8868;&#x3002;</p>
<h2 id="linkedhashmap-&#x7684;&#x5E94;&#x7528;">LinkedHashMap &#x7684;&#x5E94;&#x7528;</h2>
<p>&#x5728; Android &#x4E2D;&#x63D0;&#x4F9B;&#x4E86;&#x4E00;&#x4E2A; LruCache &#x7684;&#x7F13;&#x5B58;&#x6846;&#x67B6;&#xFF0C;&#x662F;&#x7528; LinkedHashMap &#x6765;&#x5B9E;&#x73B0;&#x7684;&#xFF0C;&#x8FD9;&#x4E2A;&#x540E;&#x9762;&#x518D;&#x4ECB;&#x7ECD;&#x3002;</p>
<h2 id="&#x603B;&#x7ED3;">&#x603B;&#x7ED3;</h2>
<ul>
<li>LinkedHashMap &#x662F;&#x7EE7;&#x627F;&#x4E8E; HashMap&#xFF0C;&#x662F;&#x57FA;&#x4E8E; HashMap &#x548C;&#x53CC;&#x5411;&#x94FE;&#x8868;&#x6765;&#x5B9E;&#x73B0;&#x7684;&#x3002;</li>
<li>HashMap &#x7684;&#x6570;&#x636E;&#x662F;&#x65E0;&#x5E8F;&#x7684;&#xFF0C;LinkedHashMap &#x662F;&#x6709;&#x5E8F;&#x7684;&#x3002;</li>
<li>LinkedHashMap &#x76F8;&#x5BF9;&#x4E8E; LinkedHashMap &#x5B58;&#x50A8;&#x6570;&#x636E;&#x7684;&#x65B9;&#x5F0F;&#x5E76;&#x6CA1;&#x6709;&#x53D8;&#xFF0C;&#x53EA;&#x662F;&#x591A;&#x4E86;&#x4E00;&#x4E2A;&#x53CC;&#x5411;&#x94FE;&#x8868;&#x6765;&#x7EF4;&#x6301;&#x987A;&#x5E8F;&#x3002;</li>
<li>LinkedHashMap&#x4E5F;&#x662F;&#x7EBF;&#x7A0B;&#x4E0D;&#x5B89;&#x5168;&#x7684;&#x3002;</li>
</ul>

                                
                                </section>
                            
    </div>
    <div class="search-results">
        <div class="has-results">
            
            <h1 class="search-results-title"><span class='search-results-count'></span> results matching "<span class='search-query'></span>"</h1>
            <ul class="search-results-list"></ul>
            
        </div>
        <div class="no-results">
            
            <h1 class="search-results-title">No results matching "<span class='search-query'></span>"</h1>
            
        </div>
    </div>
</div>

                        </div>
                    </div>
                
            </div>

            
                
                <a href="java-basic-knowledge-about-string.html" class="navigation navigation-prev navigation-unique" aria-label="Previous page: Java 基础 -- 深入理解 String">
                    <i class="fa fa-angle-left"></i>
                </a>
                
                
            
        
    </div>

    <script>
        var gitbook = gitbook || [];
        gitbook.push(function() {
            gitbook.page.hasChanged({"page":{"title":"Java 基础 -- LinkedHashMap 的使用和原理","categories":"Java","comments":true,"tags":["Java"],"description":"介绍 LinkedHashMap 的使用和原理","date":"2013-06-30T10:00:00.000Z","level":"1.1.20","depth":2,"previous":{"title":"Java 基础 -- 深入理解 String","level":"1.1.19","depth":2,"path":"source/Java/java-basic-knowledge-about-string.md","ref":"source/Java/java-basic-knowledge-about-string.md","articles":[]},"dir":"ltr"},"config":{"plugins":["expandable-chapters","livereload"],"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"pluginsConfig":{"expandable-chapters":{},"livereload":{},"highlight":{},"search":{},"lunr":{"maxIndexSize":1000000,"ignoreSpecialCharacters":false},"sharing":{"facebook":true,"twitter":true,"google":false,"weibo":false,"instapaper":false,"vk":false,"all":["facebook","google","twitter","weibo","instapaper"]},"fontsettings":{"theme":"white","family":"sans","size":2},"theme-default":{"styles":{"website":"styles/website.css","pdf":"styles/pdf.css","epub":"styles/epub.css","mobi":"styles/mobi.css","ebook":"styles/ebook.css","print":"styles/print.css"},"showLevel":false}},"theme":"default","pdf":{"pageNumbers":true,"fontSize":12,"fontFamily":"Arial","paperSize":"a4","chapterMark":"pagebreak","pageBreaksBefore":"/","margin":{"right":62,"left":62,"top":56,"bottom":56}},"structure":{"langs":"LANGS.md","readme":"README.md","glossary":"GLOSSARY.md","summary":"SUMMARY.md"},"variables":{},"title":"寒江蓑笠的博客","gitbook":"*"},"file":{"path":"source/Java/java-basic-linkedhashmap.md","mtime":"2022-05-17T10:49:59.387Z","type":"markdown"},"gitbook":{"version":"3.2.3","time":"2022-05-17T10:54:58.084Z"},"basePath":"../..","book":{"language":""}});
        });
    </script>
</div>

        
    <script src="../../gitbook/gitbook.js"></script>
    <script src="../../gitbook/theme.js"></script>
    
        
        <script src="../../gitbook/gitbook-plugin-expandable-chapters/expandable-chapters.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-livereload/plugin.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search-engine.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-search/search.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/lunr.min.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-lunr/search-lunr.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-sharing/buttons.js"></script>
        
    
        
        <script src="../../gitbook/gitbook-plugin-fontsettings/fontsettings.js"></script>
        
    

    </body>
</html>

